<?php

/**
* @copyright   (C) 2010 iJoomla, Inc. - All rights reserved.
* @license  GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html) 
* @author  iJoomla.com webmaster@ijoomla.com
* @url   http://www.ijoomla.com/licensing/
* the PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript  
* are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0 
* More info at http://www.ijoomla.com/licensing/
*/

defined('_JEXEC') or die('Restricted access');

class FormatTime{
	
	function changeDateFormat($data_time, $format){
		$return = "";
		$date_time_array = explode(" ", $data_time);
		$date = $date_time_array["0"];
		$time = $date_time_array["1"];
		switch($format){
			case "1" : {
				$explode = explode("-", $date);
				$return = $explode["2"]."-".$explode["0"]."-".$explode["1"]." ".$time;
				break;
				}
			case "2" : {
				$explode = explode("-", $date);
				$return = $explode["2"]."-".$explode["1"]."-".$explode["0"]." ".$time;
				break;
				}
			case "3" : {				
				$return = $data_time;
				break;
				}
			case "4" : {
				$explode = explode("-", $date);
				$return = $explode["0"]."-".$explode["2"]."-".$explode["1"]." ".$time;
				break;
				}			
		}
		return $return;
	}
};

?>